<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
</head>

<body>
    <!-- <button type="button" onclick="SayHi()">点击调用方法</button> -->
    <!-- <button type="button" id="btn">点击调用方法</button> -->
</body>

</html>
<script>
    function SayHi(names, age) {
        // document.write("Hi~ o(*￣▽￣*)ブ");
        alert("Hi~ o(*￣▽￣*)ブ" + names + "年龄：" + age);
    }

    // let btn = document.getElementById("btn");

    // // btn.onclick = SayHi;

    // btn.addEventListener("click", SayHi);
    //方法的调用
    SayHi(prompt("请输入姓名"), prompt("请输入年龄"));
</script>